<template>
  <descriptions :value="options" :column="4" />
</template>

<script>
import Descriptions from "@/components/basic/Descriptions.vue";
const SCHEMA = [
  { label: "合同编号", name: "contractNo" },
  { label: "单据编号", name: "orderNo" },
  { label: "制单人", name: "createManDesc" },
  { label: "制单日期", name: "createOrderTime" }
];
export default {
  name: "OrderDescriptions",
  components: { Descriptions },
  props: {
    value: Object,
    column: {
      type: Number,
      default() {
        return 4;
      }
    }
  },
  computed: {
    source() {
      const source = this.value || {};
      return {
        ...source
      };
    },
    options() {
      const options = SCHEMA.map((schema) => {
        return { ...schema, value: this.source[schema.name] };
      });
      return [...options];
    }
  }
};
</script>
